Optional implementation that allows holding null values.
Retrieves the value if it's present, or throws NoSuchElementException otherwise.
Retrieves the value if it's present, or returns null.
Transforms the value with the ifPresent function if it's present, or the one provided by ifEmpty otherwise.
Returns the value if it's present, or default otherwise.
Returns the value if it's present, or the one provided by the action otherwise.
Executes the provided action if the value is absent.
Executes the provided action if the value is present.
Transforms the value with the provided action if it's present.